From: Aravindh Puthiyaparambil Date: Fri, 27 Apr 2012 15:57:55 +0000 (+0200) Subject: x86: Add FS and GS base to HVM VCPU context X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=b7fa98fbf14f8e08919e9e0d531fa2472619d26e;p=xen.git x86: Add FS and GS base to HVM VCPU context Add FS and GS base to the HVM VCPU context returned by xc_vcpu_getcontext(). Signed-off-by: Aravindh Puthiyaparambil Committed-by: Jan Beulich --- diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 168147fa98..a79f581e19 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1590,8 +1590,23 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c) c.nat->user_regs.es = sreg.sel; hvm_get_segment_register(v, x86_seg_fs, &sreg); c.nat->user_regs.fs = sreg.sel; +#ifdef __x86_64__ + c.nat->fs_base = sreg.base; +#endif hvm_get_segment_register(v, x86_seg_gs, &sreg); c.nat->user_regs.gs = sreg.sel; +#ifdef __x86_64__ + if ( ring_0(&c.nat->user_regs) ) + { + c.nat->gs_base_kernel = sreg.base; + c.nat->gs_base_user = hvm_get_shadow_gs_base(v); + } + else + { + c.nat->gs_base_user = sreg.base; + c.nat->gs_base_kernel = hvm_get_shadow_gs_base(v); + } +#endif } else {